package com.demo;

//第一个线程
class ThreadA extends Thread{
	private OrderService os;
	public ThreadA(OrderService os){
		this.os = os;
	}
	public void run(){
		os.update();
	}
}
//第二个线程
class ThreadB extends Thread{
	private OrderService os;
	public ThreadB(OrderService os){
		this.os = os;
	}
	public void run(){
		os.find();
	}
}
public class OrderServiceTest {

	public static void main(String[] args) throws InterruptedException {
		OrderService os = new OrderService();
		ThreadA a  =new ThreadA(os);
		ThreadB b  =new ThreadB(os);
		a.start();
		//Thread.sleep(500);
		b.start();
	}

}
